#!/bin/bash
# test ip
master_ip='192.168.1.'
declare -i ping_result
for last_ip in {1..10..2} 
do
	tested_ip="${master_ip}${last_ip}"
	ping -c 1 -w 1 ${tested_ip} &> /dev/null
	ping_result=$?
	if [ $ping_result -eq 0 ]
	then
		echo "server ${tested_ip} is UP"	
	else
		echo "server ${tested_ip} is DOWN"
	fi
done
exit 0
